﻿<%@ Page Title="Cungmuanao.com - Quản Lý giới thiệu" Language="C#" MasterPageFile="~/Admin/Admin.master" 
   ValidateRequest="false" AutoEventWireup="true" CodeFile="ManagePages.aspx.cs" Inherits="Admin_ManagePages" %>
<%@ Import Namespace="DTO" %>
<%@ Register src="../Controls/FileUploadFullPath.ascx" tagname="FileUpload" tagprefix="uc1" %>
<%--<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>--%>
<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="LeftContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<%--<script type="text/javascript" src="../js/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function () {
        nicEditors.allTextAreas()
    });
</script>--%>

    <div class="title">Quản lý giới thiệu</div>
    <div class="body" onload="window_onload()">
<asp:DetailsView runat="server" ID="dvwCurrBracnh" DefaultMode="Edit"
        AutoGenerateRows="False" DataKeyNames="ID" Width="100%"
    HeaderText="" AutoGenerateEditButton="True" 
    DataSourceID="objCurrPage" onitemcreated="dvwCurrBracnh_ItemCreated" >
    <Fields>
        <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="true" InsertVisible="false"
               SortExpression="ID" />
         <asp:BoundField DataField="AddedDate" HeaderText="Ngày t&#7841;o" InsertVisible="False"
            ReadOnly="True" SortExpression="AddedDate" />
         <asp:BoundField DataField="AddedBy" HeaderText="Ng&#432;&#7901;i t&#7841;o" InsertVisible="False" ReadOnly="True"
            SortExpression="AddedBy" />                
        <asp:TemplateField HeaderText="Tiêu đề">
            <EditItemTemplate>
                <asp:TextBox runat="server" ID="txtName" Text='<%#Bind("Title") %>' Width="99%" />
                <asp:RequiredFieldValidator ID="valRequireName" runat="server" ControlToValidate="txtName" SetFocusOnError="true"
                  Text="Bắt buộc nhập tiêu đề" ToolTip="Bắt buộc nhập tiêu đề" Display="Dynamic"></asp:RequiredFieldValidator>
            </EditItemTemplate>
        </asp:TemplateField>
        
        <asp:TemplateField HeaderText="Mức độ">
            <EditItemTemplate>
                <asp:TextBox runat="server" ID="txtNumber" Text='<%#Bind("Importance") %>' Width="99%" />
            </EditItemTemplate>
        </asp:TemplateField>
        
        <asp:TemplateField HeaderText="Tóm tắt">
            <EditItemTemplate>
                <asp:TextBox runat="server" ID="txtAddress" Text='<%#Bind("Abstract") %>' Width="99%" />
            </EditItemTemplate>
        </asp:TemplateField>
        
        <asp:TemplateField HeaderText="Nội dung">
            <EditItemTemplate>
              <%-- <FCKeditorV2:FCKeditor ID="FCKeditor1" BasePath="~/fckeditor/" runat="server" Value='<%# Bind("Body") %>' 
               ToolbarSet="Simple" Height="500px" Width="100%" />    --%>       
               <%--<asp:TextBox ID="FCKeditor1" runat="server" Text='<%# Bind("Body") %>' Rows="20" TextMode="MultiLine" Width="690px" MaxLength="4000"></asp:TextBox>--%>                   
               <CKEditor:CKEditorControl ID="txtBody" runat="server" Text='<%# Bind("Body") %>'></CKEditor:CKEditorControl>
            </EditItemTemplate>
        </asp:TemplateField>
          <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/nhaplai.png" 
              CancelText="Nhập  lại" InsertImageUrl="~/Images/themmoi.png" 
              InsertText="Thêm mới" ShowInsertButton="True" ShowEditButton="True"
              UpdateImageUrl="~/Images/capnhat.png" UpdateText="Cập nhật" />        
    </Fields>
    </asp:DetailsView>
    <uc1:FileUpload ID="FileUpload1" runat="server" />
    <asp:ObjectDataSource runat="server" ID="objCurrPage" TypeName="BLL.Pages.Pages" SelectMethod="GetPage" 
    InsertMethod="InsertPage" UpdateMethod="UpdatePage">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="PageID" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="importance" Type="Int32" />
            <asp:Parameter Name="Abstract" Type="String" />
            <asp:Parameter Name="body" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="id" Type="Int32" />
            <asp:Parameter Name="title" Type="String" />
            <asp:Parameter Name="importance" Type="Int32" />
            <asp:Parameter Name="Abstract" Type="String" />
            <asp:Parameter Name="body" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
    </div>
    <div class="bottom"></div>
</asp:Content>

